Skip to content

Conversation

@samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented Apr 9, 2025

This commit adds a comprehensive file context tracking system that monitors file operations (reads, edits) by both Roo and users. The system helps prevent stale context issues and improves checkpoint management.

Key features:

  • Track files accessed via tools, mentions, or edits
  • Monitor file changes outside of Roo using file watchers
  • Store file operation metadata with timestamps
  • Trigger checkpoints correctly when Roo edit file
  • Prevent false positives by distinguishing between Roo and user edits

The implementation includes:

  • New FileContextTracker class to manage file operations
  • Type definitions for file metadata tracking
  • Integration with all file-related tools
  • File mention tracking in the mentions system
  • Improved checkpoint triggering based on file modifications

Context

Thanks @canvrno inspired by cline/cline#2648,

Implementation

Screenshots

before after

How to Test

Get in Touch


Important

Introduces FileContextTracker to monitor file operations, integrate with tools, and manage context updates, preventing stale context issues.

  • Behavior:
    • Introduces FileContextTracker to track file operations (reads, edits) by Roo and users.
    • Monitors file changes outside of Roo using file watchers.
    • Stores file operation metadata with timestamps.
    • Triggers checkpoints when Roo edits files.
    • Differentiates between Roo and user edits to prevent false positives.
  • Integration:
    • Integrates FileContextTracker with tools like applyDiffTool, insertContentTool, readFileTool, and others to track file operations.
    • Updates parseMentions to track file mentions.
  • Types:
    • Adds FileMetadataEntry, RecordSource, and TaskMetadata types in FileContextTrackerTypes.ts.
  • Misc:
    • Adds taskMetadata to GlobalFileNames.

This description was created by Ellipsis for bc770b6. It will automatically update as commits are pushed.

This commit adds a comprehensive file context tracking system that monitors file operations (reads, edits) by both Roo and users. The system helps prevent stale context issues and improves checkpoint management.

Key features:
- Track files accessed via tools, mentions, or edits
- Monitor file changes outside of Roo using file watchers
- Store file operation metadata with timestamps
- Trigger checkpoints automatically when files are modified
- Prevent false positives by distinguishing between Roo and user edits

The implementation includes:
- New FileContextTracker class to manage file operations
- Type definitions for file metadata tracking
- Integration with all file-related tools
- File mention tracking in the mentions system
- Improved checkpoint triggering based on file modifications
@changeset-bot
Copy link

changeset-bot bot commented Apr 9, 2025

⚠️ No Changeset found

Latest commit: b26eef2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 9, 2025
samhvw8 and others added 2 commits April 10, 2025 00:23
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@samhvw8 samhvw8 force-pushed the file-content-tracking branch from cdcb213 to 757f22a Compare April 9, 2025 17:24
@mrubens
Copy link
Collaborator

mrubens commented Apr 10, 2025

Playing around with this, I see a lot of user_edit_date that are set for files that I didn't actually update (and are extremely close to Roo read/write dates, in a way that doesn't seem possible if a human was actually doing them). Any ideas? Am I confused?

Screenshot 2025-04-10 at 10 23 51 AM

@mrubens
Copy link
Collaborator

mrubens commented Apr 10, 2025

Talked to @samhvw8 and this seems good. Nice work @canvrno ❤️

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 10, 2025
@mrubens mrubens merged commit 5352beb into RooCodeInc:main Apr 10, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 10, 2025
@samhvw8 samhvw8 deleted the file-content-tracking branch April 10, 2025 15:01
SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
* manual port

* successfully open remote chrome

* clean up auto-detect vs specified path

* move the browser settings into regular settings

* changeset & prettier

* correct chrome path description, remove some old comments, and rename headless mode to local mode

* rename incorrect headless mode to 'local mode'

* Sub-PR of hugelung/remote_browser: clicking browser widget's gear opens basic settings & scrolls down with a highlight (RooCodeInc#2439)

* first version of scrolling to browser settings

* really nice generic scroll to settings & highlight

* formatting & changeset

---------

Co-authored-by: Andrei Edell <[email protected]>

* added feature to detect and display chrome path as placeholder in browser settings (RooCodeInc#2442)

Co-authored-by: Andrei Edell <[email protected]>

* Features to relaunch browser in debug, test connection (RooCodeInc#2440)

* Features to Relaunch browser in debug, test connection

* Update src/services/browser/BrowserSession.ts

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* Update webview-ui/src/components/browser/BrowserSettingsMenu.tsx

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: Andrei Edell <[email protected]>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* fix a merge conflict resolution error

* fix linter issue

* clarify settings descriptions

* Remove sketchy network scanning code

* respect viewport size in remote host

* headless browser fix (RooCodeInc#2451)

* Disable notifications in browser

* start of info panel popover (RooCodeInc#2453)

* start of info panel popover

* remove duplicated message & prettier fix

* Revert "remove duplicated message & prettier fix"

This reverts commit dcefef35aacfc9d9a8461d37805c2ffb64b558c4.

* info styling, close browser tab, hide headless info

---------

Co-authored-by: Andrei Edell <[email protected]>

* remove headless checkbox

* settings layout rework & more auto

* new chrome flags experiments

* make headless choice automatic & phrasing & visual cleanups

* auto-recheck chrome connection every second

- while we are looking at settings
- while we have remote debugging enabled

* continuous remote connection testing & ux cleanup

* remove advanced settings from package.json

* format fixes

* dont display connection type after dc to smooth over ui of reloading tasks

* seems we need package-lock now for ci

* Revert "remove advanced settings from package.json"

This reverts commit 5defe4a8cae7631bcf9c1fb9efa874e3238c5034.

* relaunch correctly with default session

* prevent about:blank opening on relaunch

* Resolve merge conflicts with refactor

* add browser tool telemetry

* try launching chrome using node spawn_child to detach it

* browser settings update

* do async dispose for browsersession

* remove duplicated message implementation

* Remove remote browser settings from configuration, and enhance browser settings UI with an advanced settings button.

* Remove updateBrowserSettings

* Fix text with chrome path

* fix arafat's pr note about multiple timers

* fix saoud's note about require use

* Remote browser logging (RooCodeInc#2682)

* logging

* reduce logging levels

---------

Co-authored-by: Andrei Edell <[email protected]>

* Make browser status popup adapt to viewport width

* remove requires for exec/spawn

* remove unneeded comments

* error telemetry

* remove headless mode / settings everywhere

* migrate values list to simple endpoint string

* fix log spam and clean up a comment

* Fixes; copy

* Remove local state since we're already using extension state

* Remove unnecessary remoteBrowserHost and remoteBrowserEnabled states

* Fix status wrapping

---------

Co-authored-by: Andrei Edell <[email protected]>
Co-authored-by: canvrno <[email protected]>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: canvrno <[email protected]>
Co-authored-by: Saoud Rizwan <[email protected]>
Co-authored-by: frostbournesb <[email protected]>
Co-authored-by: Dennis Bartlett <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants